const copy = function(id){
	const input = document.createElement('input');
	document.body.appendChild(input);
	input.setAttribute('value', id);
	input.select();
	if (document.execCommand('copy')) {
		document.execCommand('copy');
		// ELEMENT.Message.success('复制成功')
    vant.Toast('复制成功');
		//成功
	}else{
		// ELEMENT.Message.error('复制失败')
    vant.Toast('复制失败');
		//失败
	}
	document.body.removeChild(input);
}

const go = function(url,id) {
	this.$router.push({
		path:url,
		query:{
			id:id
		}
	})
}

const openw = function(url,id) {
	window.open(url)
}

const cun = function(who,zhi){
  localStorage.setItem(who,zhi)
}

const back = function() {
	this.$router.go(-1)
}


export {copy,go,cun,openw,back}
